#include <iostream>
#include <cstdlib>
using namespace std;

/*
class NODE{
	char *data;
	NODE *left,*right;
public :
	NODE(char *);
	NODE(char *data,NODE * left, NODE * right);
	~NODE();
};
NODE::NODE(char *data){
	this->data=data;
	left=NULL;
	right=NULL;
}
NODE:: NODE(char *data, NODE * left,NODE *right){
	this->data=data;
	this->left=left;
	this->right=right;
}
NODE::~NODE(){
	delete data;
	delete left;
	delete right;
}
int main(){
	char *a;
	NODE node(a);
	return 0;
}


class INTLIST{
	int *list;
	int size;
	int used;
public:
	INTLIST(int s);
	int insert(int v);
	int remove(int v);
	int find(int v);
	int get(int k);
	~INTLIST();
};
INTLIST::INTLIST(int s){
	if(list=new int[s]){
		size=s;
		used=0;
	}
}
int INTLIST::find(int v){
	for(int i=0;i<this->used;i++){
		if(list[i]==v)return 1;
	}
	return 0;
}
int INTLIST::insert(int v){
	if(used<size)
	{
		list[used++]=v;
		return 1;
	}
	return 0;
}
int INTLIST::get(int k){
	if(k-1>used)return 0;
	return list[k-1];
}
int INTLIST::remove(int v){
	int tochange=0;
	if(list[used-1]==v){
		used--;
		return 1;
	}
	for(int i=0;i<this->used-1;i++)
	{
		if(list[i]==v)tochange=1;
		if(tochange==1){
			list[i]=list[i+1];
		}
	}
	if(tochange==0)return 0;
	else return 1;
}
INTLIST::~INTLIST(){
	if(list){
		delete list;
		list=NULL;
		size=0;
		used=0;
	}
}
int main()
{
	INTLIST list(10);
}

*/
int sum(int count, ...){
	int sum=0,*p=&count+1;
	for(int i=0;i<count;i++)sum+=p[i];
	return sum;
}

int main(){
	cout<< "1+2+3+4+5="<<sum(5,1,2,3,4,5)<<endl;
	return 0;
}
/*
class SET{
	int *set;
	int card;
	int used;
public:
	SET(int card);
	~SET();
	int size();
	int insert(int v);
	int remove(int v);
	int has(int v);
};
SET::SET(int card){
	set=(int *)::malloc(sizeof(int )*card);
	this->card=card;
	used=0;
}
SET::~SET(){
	delete set;
}
int SET::size(){
		return used;
}
int SET::insert(int v){
	if(used<card){
		set[used]=v;
		used++;
		return 1;
	}
	return 0;
}
int SET::remove(int v){

}
int SET::has(int v){
	for(int i=0;i<used;i++){
		if(set[i]==v)return 1;
	}
	return 0;
}
*/
